Skip to content

Conversation

@mazen-r
Copy link
Contributor

@mazen-r mazen-r commented Jan 23, 2025

No description provided.

@mazen-r mazen-r requested a review from jjsaunier January 23, 2025 10:03
"""

if len(data) < 2:
return 'unknown'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be None


# gzip
if data[0] == 0x1f and data[1] == 0x8b:
return 'gzip'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can directly use the CompressionFormatEnum, remove the translation between string to enum and add a return type accordingly

]
for magic in zstd_magic_numbers:
if data[:len(magic)] == magic:
return 'zstd'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CompressionFormatEnum

# deflate
if data[0] == 0x78:
if data[1] in (0x01, 0x5E, 0x9C, 0xDA):
return 'deflate'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CompressionFormatEnum

@jjsaunier jjsaunier merged commit 8efa12a into config-serialization-support Jan 24, 2025
jjsaunier pushed a commit that referenced this pull request Jan 24, 2025
* add config serialization/deserialization support

* fix wrong types on config conversion

* support zstd and deflate auto compression (#29)

* support zstd and deflate auto compression

* add auto compression detection support

* update auto compression detection

* use enums directly

* remove debugging line and update method singature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants